<!DOCTYPE html>
<!--把html 的名称空间，改成：xmlns:th="http://www.thymeleaf.org" 会有语法提示-->
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:easyui="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
    <title>菜单管理</title>
    <script type="text/javascript" src="../../static/easyui/boot.js" th:src="@{/static/easyui/boot.js}"></script>
</head>
<body class="easyui-layout">
<div id="tb" style="padding:10px;height:auto">
    <easyui:button label="新增" vtype="add" name="butAdd" onclick="add()"/>
    <easyui:button label="编辑" vtype="edit" name="butEdit" onclick="edit()"/>
    <easyui:button label="删除" vtype="del" name="butDel"/>
    <easyui:button label="查询" vtype="search" name="butSearch"/>
    <easyui:button label="重置" vtype="reset" name="butReset"/>
    <easyui:button label="刷新" vtype="reload" name="butreload"/>
    <easyui:button label="上传" vtype="upload" name="upload"/>
    <easyui:button label="下载" vtype="download" name="download"/>
    <easyui:button label="保存" vtype="save" name="save"/>
    <easyui:button label="关闭" vtype="close" name="close"/>
</div>
<table id="dg" class="easyui-datagrid" style="width:100%;height:100%" idfield="id"
       url="/sysAccount/getAccountList.do"
       toolbar="#tb" fitcolumns="true" singleselect="true" nowrap="true"
       rownumbers="true" pagination="true">
    <thead>
    <tr align="center">
        <th field="ck" checkbox="true"></th>
        <th field="id" resizable="true" halign="center" width="10" align="center" sortable="false" hidden="hidden">ID</th>
        <th field="code" resizable="true" halign="center" width="100" align="center" sortable="true">登陆账号</th>
        <th field="name" resizable="true" halign="center" width="100" align="center" sortable="true">用户名</th>
        <th field="mobile" resizable="true" halign="center" width="100" align="center" sortable="true">手机号</th>
        <th field="status" resizable="true" halign="center" width="100" align="center" sortable="true">状态</th>
        <th field="createTime" resizable="true" halign="center" width="100" align="center" sortable="true">创建时间</th>
    </tr>
    </thead>
</table>
</body>
</html>
<script type="text/javascript">
    var id="";
    $(document).ready(function () {

    });
    function getUrl() {
        return apiPrefix('/sysAccount/getAccountList.do');
    }

    //添加
    function add(){
        windowsOpen("新增用户","/sysAccount/edit.do?id=0",900,500,function(){
            $('#dg').datagrid('reload');
        });
    }
    //编辑
    function edit(){
        var data = $("#dg").datagrid("getSelected");
        if(data){
            windowsOpen("编辑用户","/sysAccount/edit.do?id="+data.id,900,500,function(){
                $('#dg').datagrid('reload');
            });
        }else{
            showAlert("提示","请勾选一条数据后再操作!");
        }
    }


</script>